/**
 * Created by Administrator on 2017/11/14.
 */

function check_414() {

    var lastarr = new Array();
    var nowarr = new Array();
    $("input[name='last[]']").each(function () {
        lastarr[$(this).attr('id')] = $(this).val();
    })
    $("input[name='now[]']").each(function () {
        nowarr[$(this).attr('id')] = $(this).val();
    })
/*    if (lastarr['last_d8']!=''){
        if (lastarr['last_d5']!= '' || lastarr['last_d6']!= '' || lastarr['last_d7']!= ''){
            return '当选择8后不能选择5,6,7';
        }
        if (lastarr['last_d8'] != '是'){
            return "请用'是'来选择企业类别！";
        }
    }else{
        if (lastarr['last_d5']!= '是' && lastarr['last_d5']!=''){
            return "请用'是'来选择企业类别！";
        }
        if (lastarr['last_d6']!= '是' && lastarr['last_d6']!=''){
            return "请用'是'来选择企业类别！";
        }
        if (lastarr['last_d7']!= '是' && lastarr['last_d7']!=''){
            return "请用'是'来选择企业类别！";
        }
    }

    if (nowarr['now_d8']!=''){
        if (nowarr['now_d5']!= '' || nowarr['now_d6']!= '' || nowarr['now_d7']!= ''){
            return '当选择8后不能选择5,6,7';
        }
        if (nowarr['now_d8'] != '是'){
            return "请用'是'来选择企业类别！";
        }
    }else{
        if (nowarr['now_d5']!= '是' && nowarr['now_d5']!=''){
            return "请用'是'来选择企业类别！";
        }
        if (nowarr['now_d6']!= '是' && nowarr['now_d6']!=''){
            return "请用'是'来选择企业类别！";
        }
        if (nowarr['now_d7']!= '是' && nowarr['now_d7']!=''){
            return "请用'是'来选择企业类别！";
        }
    }*/

    if (lastarr['last_d18']!='' && lastarr['last_d19']!='' && lastarr['last_d20']!='' && lastarr['last_d17']!=''){
        if (parseInt(lastarr['last_d18'])+parseInt(lastarr['last_d19'])+parseInt(lastarr['last_d20']) != parseInt(lastarr['last_d17'])){
            return '上年专利数量与子级之和应相等';
        }
    }

    if (nowarr['now_d18']!='' && nowarr['now_d19']!='' && nowarr['now_d20']!='' && nowarr['now_d17']!=''){
        if (parseInt(nowarr['now_d18'])+parseInt(nowarr['now_d19'])+parseInt(nowarr['now_d20']) != parseInt(nowarr['now_d17'])){
            return '本年专利数量与子级之和应相等';
        }
    }

    if (lastarr['last_d22']!='' && lastarr['last_d23']!='' && lastarr['last_d24']!='' && lastarr['last_d21']!=''){
        if (parseInt(lastarr['last_d22'])+parseInt(lastarr['last_d23'])+parseInt(lastarr['last_d24']) != parseInt(lastarr['last_d21'])){
            return '上年技术研发机构与子级之和应相等';
        }
    }

    if (nowarr['now_d22']!='' && nowarr['now_d23']!='' && nowarr['now_d24']!='' && nowarr['now_d21']!=''){
        if (parseInt(nowarr['now_d22'])+parseInt(nowarr['now_d23'])+parseInt(nowarr['now_d24']) != parseInt(nowarr['now_d21'])){
            return '本年技术研发机构与子级之和应相等';
        }
    }

    if (lastarr['last_d25']!='' && lastarr['last_d26']!='' && lastarr['last_d27']!='' && lastarr['last_d28']!=''){
        if (parseInt(lastarr['last_d28'])+parseInt(lastarr['last_d26'])+parseInt(lastarr['last_d27']) != parseInt(lastarr['last_d25'])){
            return '上年品牌建设与子级之和应相等';
        }
    }

    if (nowarr['now_d25']!='' && nowarr['now_d26']!='' && nowarr['now_d27']!='' && nowarr['now_d28']!=''){
        if (parseInt(nowarr['now_d28'])+parseInt(nowarr['now_d26'])+parseInt(nowarr['now_d27']) != parseInt(nowarr['now_d25'])){
            return '本年品牌建设与子级之和应相等';
        }
    }


    return '';
}